(function(angular) {
	"use strict";
	angular.module("fs.waf").controller("cls.popup.txnFeeView.viewController", viewController);
	viewController.$inject = [ "$scope", "$filter", "dialogsModule", "$uibModalInstance", "modalService", "layoutConfig", "validatorConfig", "authService" ];
	function viewController($scope, $filter, dialogsModule, $uibModalInstance, modalService, layoutConfig, validatorConfig, authService) {
		var ctrl = this;
		ctrl.dialogsModule = dialogsModule;
		ctrl.validatorConfig = validatorConfig;
		ctrl.close = function() {
			if (!dialogsModule.btnCallback || !dialogsModule.btnCallback["close"] || dialogsModule.btnCallback["close"]() !== false) {
				$uibModalInstance.dismiss();
			}
		};

		ctrl.init = function() {
			authService.view(ctrl.dialogsModule.params).then(function(response) {
				ctrl.txnFee = response.data || ctrl.dialogsModule.params;
				ctrl.layoutConfig = layoutConfig;
			}, angular.noop);
		};

		ctrl.feeAmortize = function() {
			modalService.openCustomDialogs({
				"title" : "title.popup.list.feeamortize",
				"dialogsModule" : "cls.loan.feeAmortizeList",
				"size" : [ 800, 300 ],
				"params" : ctrl.txnFee,
				"btnCallback" : {
					"ok" : function() {
					}
				}
			});
		};

	}
})(angular);